<?php
class ArticleModule
{
	public function show()
	{
		global $_FANWE;
		$id = intval($_FANWE['request']['id']);
		if($id == 0)
			fHeader('location:./');
			
		$cache_args = array(
			$id,
		);
		
		$cache_file = getTplCache('page/article_show',$cache_args);
		if(!@include($cache_file))
		{
			$article = DB::fetchFirst('SELECT a.*,ac.name as cate_name FROM '.DB::table('article').' AS a 
								LEFT JOIN '.DB::table('article_cate').' AS ac ON ac.id = a.cate_id 
								WHERE a.id = '.$id.' AND a.status = 1');
			if(!$article)
				fHeader('location:./');
				
			$_FANWE['nav_title'] = $article['name'].'-'.$article['cate_name'];
			include template('page/article_show');
		}
		
		display($cache_file);
	}
}
?>